package com.bawei.es.service;

import com.bawei.common.core.domain.R;
import org.elasticsearch.script.Script;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface EsIndexService {
    R<Boolean> indexCreates(String indexName, Map<String, Object> settings);
    R<Boolean> indexExit(String indexName);

    R<Boolean> indexDelete(String indexName);

    R<Boolean> indexCreateWithMapping(String indexName, String indexMapping);


    void reindexWithNewFields(String sourceIndex, String targetIndex, Script script) throws IOException;

    R<Map<String, Object>> indexGetMapping(String indexName);

    List<String> findIndex();

}
